package lc.oa.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.viewpager.widget.ViewPager;

import lc.oa.R;
import lc.oa.ui.LeaveActivity;
import lc.oa.ui.base.BaseFragment;
import lc.oa.ui.fragmentLeave;
/**
  *
  * @Description:     首页 
  * @Author:         lucifer
  * @CreateDate:     2020/8/7 16:13
  * @UpdateUser:
  * @UpdateDate:
  * @UpdateRemark:
  * @Version:        1.0
 */
public class HomeFragment extends BaseFragment implements ViewPager.OnPageChangeListener {
    private LinearLayout ll_leaver;
    private  SetBtnClick   setBtnClick;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_home, container, false);
        return view;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        ll_leaver=getActivity().findViewById(R.id.ll_leave);
        ll_leaver.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //从fragment跳转到activity中
                startActivity(new Intent(getActivity(), LeaveActivity.class));
//                getActivity().getSupportFragmentManager().
//                        beginTransaction().replace(R.id.top_bar,new fragmentLeave(),null).
//                        addToBackStack(null).commit();

            }
        });
    }

    @Override
    protected void handlerMessage1(Message msg) {

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initControl() {

    }

    @Override
    public void onModeChanged(int action, Object... values) {

    }

    @Override
    public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {

    }

    @Override
    public void onPageSelected(int position) {

    }

    @Override
    public void onPageScrollStateChanged(int state) {

    }

    public SetBtnClick getSetBtnClick() {
        return setBtnClick;
    }

    public void setSetBtnClick(SetBtnClick setBtnClick) {
        this.setBtnClick = setBtnClick;
    }

    public interface SetBtnClick{
        public void onClick(View view);
    }

}
